Skip to main content
  1. Posts/

New Mac Setup

··8 mins

Two large commands to pretty much automatically install everything I need on a new Macbook using Homebrew

Install homebrew #

To install homebrew enter this in terminal

/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
brew tap homebrew/cask-versions

Note: if you find any failures with installation, or issues with a previously installed brew on a non-new machine, try running brew doctor to see some ways to fix:

sudo chown -R $(whoami) /usr/local/share/zsh /usr/local/share/zsh/site-functions
chmod u+w /usr/local/share/zsh /usr/local/share/zsh/site-functions

brew install #

This installs ‘formulae’ which are mostly CLI apps and tools like node, kubectl, etc.

These will usually be installed in a local homebrew folder with symbolic links placed in /usr/local/bin

Note: go through and remove any tools you know you wont need, e.g. specific node / postgres versions, before blindly copy/pasting/running the command

# necessary step if mongo is required
brew tap kong/kong
brew tap mongodb/brew
brew tap homebrew/cask-fonts
brew install brew-cask-completion certbot consul fastlane gnu-sed go google-java-format goplus gotests grpcurl helm hugo imagemagick jq kompose kong kubernetes-cli kustomize liquibase macos-term-size maven minikube mongodb-community mongodb-database-tools mysql node node@14 openjdk openjdk@8 openjdk@11 postgresql protobuf redis starship thefuck tree vault vegeta yq

brew install --cask #

This installs full-blown, native MacOS programs (called ‘casks’)and places them in your Applications folder

Before using this, you would have to go to the 1Password download page, the Alfred page, the Brave page individually, then download each of the applications, then open the .dmg files and move them to the Applications folder manually

All of that is now replaced with a single command (and maybe typing your password and hitting the enter key a few times)!!!

Note: go through and remove any applications you know you wont need, e.g. you might not need ALL of the IDEs and only need visual-studio-code or you need intellij-idea-ce instead of intellij-idea (Ultimate).

brew install --cask 1password 1password-cli alfred amethyst anaconda android-studio beyond-compare blender boom-3d brackets brainfm brave-browser burp-suite calibre caffeine ccleaner chromium cleanmymac cyberduck dataspell diffmerge discord docker emacs evernote firefox flutter font-fantasque-sans-mono-nerd-font font-go-mono-nerd-font font-hack-nerd-font font-iosevka-nerd-font font-jetbrains-mono-nerd-font font-roboto-mono-nerd-font font-ubuntu-mono-nerd-font goland google-assistant google-cloud-sdk graphql-playground hacker-menu harmony hazel intellij-idea kitty odbc-manager plex-media-server postico postman pycharm rescuetime scroll-reverser send-to-kindle shellcheck steam studio-3t sublime-text unity-hub virtualbox visual-studio-code vlc vlc-webplugin vscodium warp waterfox webstorm ytmdesktop-youtube-music

Note: To avoid any permission errors when creating / removing conda environments, change the owner of ~/.conda from root to yourself:

sudo chown -R $USER ~/.conda

Additional Installs #

Maildev: npm install --global maildev

Running / tweaking installations #

  • Run brew services to see what is currently running
  • MySQL
    • Start with brew services start mysql
    • Connect with mysql -u root
    • To secure with a password, run mysql_secure_installation
  • Postgres
    • Start with brew services start postgresql
    • Connect with psql postgres
  • Redis
    • Start with brew services start redis
    • Connect with redis-cli
  • Mongo
    • Start with brew services start mongodb/brew/mongodb-community
    • Connect with mongosh
  • Consul
    • Start with brew services start consul
    • Connect with consul
  • Java 11
    • sudo ln -sfn /usr/local/opt/openjdk@11/libexec/openjdk.jdk /Library/Java/JavaVirtualMachines/openjdk-11.jdk

Oh My ZSH #

OMZ is a great utility to configure the Z Shell (zsh) which has been shipping with newer Macs

sh -c "$(curl -fsSL https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"

After installation, open in a text editor (e.g. vi ~/.zshrc), and refer to some of my configurations here

SSH Setup #

To do any meaningful work, you’ll probably need to setup your SSH key. I typically run the keygen and spam the enter key, choosing all the defaults, and then copy the key to paste wherever necessary (e.g. Gitlab, Github, store it in 1password, etc.)

# spam enter until you see the ASCII art
# auto copies public key for Gitlab / Github
ssh-keygen -t rsa -b 4096 -o -a 100 -f ~/.ssh/id_rsa -q -N '' && cat ~/.ssh/id_rsa.pub | pbcopy
# copy private key for 1Password
cat ~/.ssh/id_rsa | pbcopy

System Preferences #

  1. Displays
    1. Manually align external monitors
    2. Drag menu bar to monitor that will not ever be screen shared
  2. Mouse
    1. Scroll direction: Natural - ON (Need Scroll Reverser to fix)
    2. Secondary click - ON
    3. Smart zoom - ON
    4. Tracking speed - 7
    5. More Gestures: ALL ON
  3. Trackpad
    1. Tracking speed - 7
    2. Scroll & Zoom - ALL ON
    3. More Gestures - ALL ON
  4. General
    1. Appearance - DARK
    2. Show scroll bars - WHEN SCROLLING
    3. Click in the scroll bar to: JUMP TO THE SPOT THAT’S CLICKED
  5. Dock & Menu Bar
    1. Dock Size - 70%
    2. Dock Magnification - ON / MAX
    3. Remaining dock settings - ALL ON
    4. Menu Bar - ALL OFF
  6. Mission Control
    1. Hot Corners
      1. Top Left - Launchpad
      2. Top Right - Notification Center
      3. Bottom Left - Mission Control
      4. Bottom Right - Quick Note
  7. Language & Region
    1. Add Hindi
  8. Notifications - TURN OFF ALL
  9. Sound
    1. Play user interface sound effects – OFF
    2. Show Sound in menu bar – ALWAYS
  10. Touch ID
    1. Register additional fingers to make logging in / security checks easier (at least both pointer fingers)
  11. Keyboard
    1. Modifier Keys
      1. Swap Caps Lock and Control Key (for all keyboards)
    2. Shortcuts > Spotlight - UNCHECK Show Spotlight search
    3. Input Sources
      1. Add languages:
        • Devanagri - QWERTY
        • Hindi
        • Hindi (a -> अ)
      2. Show Input menu in menu bar - ON
    • NOTE: If input switcher doesn’t display in the menu bar, run the following command in Terminal: sudo killall -9 PAH_Extension TextInputMenuAgent TextInputSwitcher

Dock #

  1. Remove everything from the dock except for:
    1. Finder
    2. Launchpad
    3. Settings
  2. Add to the dock:
    1. Brave & Company Browser
    2. IntelliJ
    3. Goland
    4. VSCodium
    5. Postico
    6. Studio 3T
    7. Postman
    8. Warp
    9. Terminal

Finder #

  1. Open Finder > Finder Preferences (or ⌘,)
    1. General
      1. Show these items on the dekstop: Hard disks, External disks, CDs DVDs, and iPods – ON
      2. New Finder windows show: User folder
      3. Open folders in tabs instead of new windows – ON
    2. Sidebar
      1. Show these items in the sidebar – ALL ON
    3. Advanced
      1. Show all filename extensions – ON
      2. When performing a search – Search the Current Folder
  2. Navigate to User’s home folder in Finder
  3. Turn on hidden files: ⌘⇧. (⌘ + shift + .)
  4. Change to Icon View, then choose ... > Sort By > Snap to Grid
  5. Change to List View, right click > View Options
    1. Always open in list view – ON
    2. Browse in list view – ON
    3. Sort by: Date Modified
    4. Show columns:
      • Date Modified
      • Date Created
      • Size
      • Kind
      • Tags
    5. Calculate all sizes – ON
    6. Click Use as Defaults
    7. Change Sort By back to Name (just for this folder) and close View Options

App Setup #

Screenshots #

Move default location for screenshots from ~/Desktop to ~/Pictures/Screenshots

  1. Open the Screenshot app > Options > Save to – Other location
  2. Navigate to ~/Pictures and create a new folder named Screenshots
  3. Choose this folder

Brave #

Pre-requisite: On old laptop, update Brave to latest version && start sync chain / copy chain code

  1. Add laptop to sync chain
  2. Regroup tabs
  3. Import “Better OneTab” (JSON file)

1Password #

  1. Login with both company / personal accounts

Alfred setup #

Pre-requisite: On old laptop, save alfred.preferences file (or sync with Dropbox, GDrive, Git), and load on new laptop

  1. Set command + space as shortcut
  2. See additional Alfred setup and config details in this post

Scroll Reverser #

Scrolling Axes:

  • Reverse Vertical - ON
  • Reverse Horizontal - ON

Scrolling Devices:

  • Reverse Trackpad - OFF
  • Reverse Mouse - ON

RescueTime #

Pre-requisite: RescueTime account

  1. Launch RescueTime and log in.

  2. Enable Security & Privacy > Accessibility > RescueTime

  3. For each window, will have to approve RescueTime monitoring

  4. Setup RescueTime Integrations

    1. Git integration
      1. Create .git_template/hooks folder (I have mine in ~/Programming/__mine/dotfiles/.git_template/hooks)

      2. In the Git Integration page, copy the API Key, and add to your .zshrc file or your secret.zsh file: EXPORT RESCUETIME_API_KEY=pasteInApiKeyHere

      3. Copy my post-commit file to your .git_template/hooks folder

      4. Make sure the post-commit file is executable: chmod +x git_template/hooks/post-commit

      5. Edit your .gitconfig with a [init] section with templatedir pointing to .git_template folder:

        [init]
          templatedir = ~/Programming/__mine/dotfiles/git_template
          defaultBranch = master
        
  5. Results:

    • in every newly cloned git repo, it should have have the RescueTime hook added
    • for existing repos, running git init should copy over the hook

Launchpad / Applications folder #

Mac Default #

  • App Store
  • Safari
  • Mail
  • Contacts
  • Calendar
  • Reminders
  • Notes
  • Facetime
  • Messages
  • Maps
  • Find My
  • Mission Control
  • Music
  • Photo Booth
  • Photos
  • Podcasts
  • TV
  • Voice Memos
  • News
  • Stocks
  • Books
  • Dictionary
  • Home
  • Siri

Mac Util (renamed from Other) #

This has all of the “Other” default Mac apps (e.g. Terminal, Activity Monitor, Automator, Audio MIDI Setup, etc.)

CompanyName Bloatware #

This has any preloaded company specific software (e.g. VPN, App store, trackers, etc.)

M$ #

This has all Microsoft apps (e.g. Outlook, Word, Excel, Powerpoint, etc.)

No Folder #

  • Calculator
  • Preview
  • System Pref

Browsers #

  • Chrome
  • Chromium
  • Brave
  • Firefox
  • Min
  • Waterfox

Database Tools #

  • GraphQL Playground
  • ODBC Manager
  • Postico
  • Studio 3T

Dev Tools #

  • Beyond Compare
  • Brackets
  • Burp Suite Community Edition
  • Cyberduck
  • DiffMerge
  • Docker
  • Kitty
  • Postman
  • VirtualBox
  • Warp

Efficiency & Productivity #

  • 1Password
  • Alfred
  • Amethyst
  • Caffiene
  • Hazel

Entertainment #

  • Blender
  • Boom3D
  • BrainFM
  • Discord
  • Harmony
  • Plex
  • Unity hub
  • VLC
  • Youtube Music Desktop App
  • Snap Camera
  • Steam
  • iMovie
  • Garage Band
  • Logic

Graphics & Design #

  • Adobe: Photoshop, XD, Illustrator, Lightroom Classic, Lightroom

Finance #

  • Bitcoin

IDE #

  • Anaconda
  • Android Studio
  • CLion
  • Dataspell
  • Emacs
  • Goland
  • IDLE
  • IntelliJ IDEA
  • Pycharm
  • Python Launcher
  • Sublime Text
  • VS Code
  • VSCodium
  • Webstorm

Read #

  • calibre
  • Evernote
  • Hacker Menu
  • Send to Kindle

Util #

  • CCleaner
  • Clean My Mac
  • Rescue Time
  • Scroll Reverser
  • Google Assistant
  • Entrust
  • Winzip
  • Authy Desktop
  • Tiny Stopwatch